package com.spring.cloud.practice.demo.springbootrabbitmq.controller;

import com.spring.cloud.practice.demo.springbootrabbitmq.producer.Sender;
import com.spring.cloud.practice.demo.springbootrabbitmq.producer.TopicSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <b><code>RabbitMQController</code></b>
 * <p/>
 * Description
 * <p/>
 * <b>Creation Time:</b> 2019/8/6 19:39.
 *
 * @author huanghuayan
 * @since spring-cloud-demo
 */
@RestController
public class RabbitMQController {

    @Autowired
    Sender sender;

    @Autowired
    TopicSender topicSender;

    @RequestMapping("send")
    public void send() {
        sender.send();
    }

    @GetMapping("topicSend/{id}")
    public void topicSend(@PathVariable Long id) {
        topicSender.send(id);
    }
}
